<?php

/* @var $this \yii\web\View */
/* @var $content string */

use yii\helpers\Html;
use yii\helpers\Url;

$web = Url::base();
$url = Yii::$app->request->scriptUrl;
?>

<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">

    <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"/><!-- 设置状态栏的背景颜色 -->
    <meta name="apple-mobile-web-app-capable" content="yes"/>
    <!--是否启用 WebApp 全屏模式.只有在 "apple-mobile-web-app-capable" content="yes" 时生效
    content 参数：
    default 默认值。
    black 状态栏背景是黑色。
    black-translucent 状态栏背景是黑色半透明。
    如果设置为 default 或 black ,网页内容从状态栏底部开始。
    如果设置为 black-translucent ,网页内容充满整个屏幕，顶部会被状态栏遮挡。 -->

    <meta name="format-detection" content="telephone=no"/> <!-- 禁止数字识自动别为电话号码 -->

    <link rel="stylesheet" type="text/css" href="<?= $web ?>/css/mall-m/global.css"/>
    <link rel="stylesheet" type="text/css" href="<?= $web ?>/css/font-awesome.css"/>
    <link rel="stylesheet" type="text/css" href="<?= $web ?>/css/mall-m/swiper.min.css"/>
    <link rel="stylesheet" type="text/css" href="<?= $web ?>/css/mall-m/animate.min.css"/>
    <link rel="stylesheet" type="text/css" href="<?= $web ?>/css/mall-m/frame.css"/>

    <style type="text/css">
        .tab-frame .tab-item .icon-home {
            background-image: url('<?= $web ?>/images/mall-m/index-icon-tab-home.png');
        }

        .tab-frame .tab-item-selected .icon-home {
            background-image: url('<?= $web ?>/images/mall-m/index-icon-tab-home-selected.png');
        }

        .tab-frame .tab-item .icon-category {
            background-image: url('<?= $web ?>/images/mall-m/index-icon-tab-category.png');
        }

        .tab-frame .tab-item-selected .icon-category {
            background-image: url('<?= $web ?>/images/mall-m/index-icon-tab-category-selected.png');
        }

        .tab-frame .tab-item .icon-cart {
            background-image: url('<?= $web ?>/images/mall-m/index-icon-tab-cart.png');
        }

        .tab-frame .tab-item-selected .icon-cart {
            background-image: url('<?= $web ?>/images/mall-m/index-icon-tab-cart-selected.png');
        }

        .tab-frame .tab-item .icon-user {
            background-image: url('<?= $web ?>/images/mall-m/index-icon-tab-user.png');
        }

        .tab-frame .tab-item-selected .icon-user {
            background-image: url('<?= $web ?>/images/mall-m/index-icon-tab-user-selected.png');
        }
    </style>

    <script src="<?= $web ?>/js/mall-m/jquery.js" type="text/javascript" charset="utf-8"></script>
    <script src="<?= $web ?>/js/mall-m/swiper-3.3.1.jquery.min.js" type="text/javascript" charset="utf-8"></script>
    <script src="<?= $web ?>/js/mall-m/jquery.lazyload.min.js" type="text/javascript" charset="utf-8"></script>
    <script src="<?= $web ?>/js/mall-m/pinchzoom.min.js" type="text/javascript" charset="utf-8"></script>
    <script src="<?= $web ?>/js/tools.js"></script>
    <script src="<?= $web ?>/js/mall-m/wx_share.js"></script>
    <!--wx share-->
    <script src="http://res.wx.qq.com/open/js/jweixin-1.1.0.js"></script>
    <script>
        <?php
        $sign = \app\librarys\WxTools::getJs_SignPackage();
        $item = \Yii::$app->session->get(\app\models\Mall::SessionKey_CurrentInstitution);
        if ($item == null) {
            $site_name = '朵拉商城';
        } else {
            $site_name = \app\models\Mall::getCurrentInstitutionSiteName();
        }
        ?>
        wx.config({
            debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来，若要查看传入的参数，可以在pc端打开，参数信息会通过log打出，仅在pc端时才会打印。
            appId: '<?=$sign['appId']?>', // 必填，公众号的唯一标识
            timestamp:<?=$sign['timestamp']?> , // 必填，生成签名的时间戳
            nonceStr: '<?=$sign['nonceStr']?>', // 必填，生成签名的随机串
            signature: '<?=$sign['signature']?>',// 必填，签名，见附录1
            jsApiList: jsApiList_share // 必填，需要使用的JS接口列表，所有JS接口列表见附录2
        });
        wx.ready(function () {
            var url = window.location.href;

            wx_setShare({
                title: '<?=$this->title?>', // 分享标题
                imgUrl: '<?=  Url::base(true) ?>/images/mall-m/share_logo.jpg',
                desc: '<?=$site_name?>提供种类齐全的优质积分礼品。正品保障,本地配送,优质服务,尽享缤纷好礼!',
                link: url
            });
        });
    </script>
    <!--end-->
    <script type="application/javascript">
        var mySessionStorage = window.sessionStorage;
        var myLocalStorage = window.localStorage;
        var myStorage = window.localStorage;

        var width = $(window).width();
        if (width > 640) {
            width = 640;
        }
        var fontSize = (width / 320 * 20);
        $('html').css('font-size', fontSize);
        // set img src replace data-original
        iniLazyload = function () {
            $("img").lazyload({
                effect: "fadeIn"
            });
        };
        // set img src replace data-original
        myImgLazyLoad = function (parent_dom) {
            var imglist = $(parent_dom).find('img');
            $.each(imglist, function (i, item) {
                $(item).attr('src', $(item).attr('data-original'));
            });
        };
    </script>

    <?= Html::csrfMetaTags() ?>
    <title><?= Html::encode($this->title) ?></title>
</head>
<body>

<?= $content ?>

<div style="display: none;">
<script src="https://s95.cnzz.com/z_stat.php?id=1260952764&web_id=1260952764" language="JavaScript"></script>
</div>
</body>
</html>
